package oop4.graph;

public class GraphTest {
    public static void main(String[] args) {
        GraphTest test = new GraphTest();
        Triangle triangle = new Triangle(3, 4, 5);
        Rectangle rectangle = new Rectangle(4, 5);
        Circle circle = new Circle(3);
        System.out.println("三角形面积为:" + test.area(triangle) + ",周长为:" + test.round(triangle));
        System.out.println("长方形面积为:" + test.area(rectangle) + ",周长为:" + test.round(rectangle));
        System.out.println("圆形面积为:" + test.area(circle) + ",周长为:" + test.round(circle));

    }

    public double area(Graph graph) {    //返回任何一种图形的面积
        return graph.getArea();
    }

    public double round(Graph graph) {    //返回任何一种图形的周长
        return graph.getRound();
    }
}
